public class class_exercise_2 {
    public static void main(String[] args) {
       byte b1 = 10;
       byte b2 = 20;
       byte b3 = (byte) (b1+b2);
        System.out.println("b3 = " + b3);

        short s1 =1000;
        short s2=2000;
        short s3= (short) (s2 +s1);
        System.out.println("s3 = " + s3);

        char c1 = 'a';
        int num = 5;
        char letter = (char) (c1+num);
        System.out.println("letter = " + letter);

        int i1 = 5;
        int i2 = 2;
        double result = (double)i1/i2;
        System.out.println("result = " + result);

        int a1 =10;
        int a2 = 11;
        if (a1%2==0) {
            System.out.println("a1是偶数");
        }
        else {
            System.out.println("a1不是偶数");
        }
        if (a2%2==0) {
            System.out.println("a1是偶数");
        }
        else {
            System.out.println("a2不是偶数");
        }
        int a3 = 12;
        int a4 = 13;
        System.out.println(a3%2==1?"12是奇数":"12不是奇数");
        System.out.println(a4%2==1?"13是奇数":"13不是奇数");

        int hours = 89;
        int day = hours/24;
        int hour = hours%24;
        System.out.println("抗击洪水"+hours+"小时,是"+day+"天"+hour+"小时");

        int week = 2;
        week += 100;
        week %= 7;
        System.out.println("今天是周二，一百天后是周"+week);

        int x,y,z ;
        x=2;
        y=7;
        z=9;
        int max = x-y>=0?x:y;
        max = max - z>=0?max:z;
        System.out.println("max = " + max);

        int year = 2023;
        boolean jieguo = year %400==0 | ((year%4==0)&(year%100!=0));
        if(jieguo == true){
        System.out.println(year+"是闰年");}
        else {
            System.out.println(year + "不是闰年");
        }

        double hua = 80;
        double she = (hua-32)/1.8;
        System.out.println(hua+"华氏度是" + she+"摄氏度");




    }
}
